<template>
  <div class="header">
    <van-nav-bar
      :title="titles"
      :left-text="lefts"
      left-arrow
      @click-left="onClickLeft(upPage,url)"
    />
  </div>
</template>

<script>
export default {
  props: ["titles", "lefts", "upPage", "url"],
  methods: {
    onClickLeft(upPage, url) {
      if (upPage) {
        this.$router.go(-1);
      } else {
        this.$router.push(url);
      }
    }
  }
};
</script>

<style>
</style>